{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Basic SEIRS Network Model Demo\n",
    "\n",
    "**This notebook provides a demonstration of the core functionality of the Basic SEIRS Network Model and offers a sandbox for easily changing simulation parameters and scenarios.** \n",
    "For a more thorough walkthrough of the model and use of this package, refer to the README."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Installing and Importing the model code\n",
    "All of the code needed to run the model is imported from the ```models``` module of this package.\n",
    "\n",
    "#### Install the package using ```pip```\n",
    "The package can be installed on your machine by entering this in the command line:\n",
    "\n",
    "```sudo pip install seirsplus```\n",
    "\n",
    "Then, the ```models``` module can be imported into your scripts as shown here:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "from seirsplus.models import *\n",
    "from seirsplus.networks import *\n",
    "import networkx"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### *Alternatively, manually copy the code to your machine*\n",
    "*You can use the model code without installing a package by copying the ```models.py``` module file to a directory on your machine. In this case, the easiest way to use the module is to place your scripts in the same directory as the module, and import the module as shown here:*\n",
    "```python\n",
    "from models import *\n",
    "```"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Generating interaction networks\n",
    "\n",
    "This model simulates SEIRS epidemic dynamics for populations with a structured interaction network (as opposed to standard deterministic SIR/SEIR/SEIRS models, which assume uniform mixing of the population). As such, a graph specifying the interaction network for the population must be specified, where each node represents an individual in the population and edges connect individuals who have regular interactions.\n",
    "\n",
    "The interaction network can be specified by a ```networkx``` Graph object or a 2D numpy array representing the adjacency matrix, either of which can be defined and generated by any method.\n",
    "\n",
    "*Here, we use a ```custom_exponential_graph()``` generation function included in this package, which generates power-law graphs that have degree distributions with two exponential tails. For more information on this custom graph type and its generation, see the README.*\n",
    "\n",
    "**_Note:_** *Simulation time increases with network size. Small networks simulate quickly, but have more stochastic volatility. Networks with ~10,000 are large enough to produce per-capita population dynamics that are generally consistent with those of larger networks, but small enough to simulate quickly. We recommend using networks with ~10,000 nodes for prototyping parameters and scenarios, which can then be run on larger networks if more precision is required (for more on this, see README).*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEECAYAAADUGGjBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAh3UlEQVR4nO3de1hUdeLH8fcAisZFJLIkMMHLppWbRlr7I6xWozbNZM1B09KyiyUulomRoOYtq8VKU9PsaYNMUOnybPZUshWPWlgmWmq5uV1WsbyAyoxynfP7o3WKhOaIw8wgn9fz9Dxy5nDOZ442nzm377EYhmEgIiJigp+3A4iISPOh0hAREdNUGiIiYppKQ0RETFNpiIiIaQHeDuAO/fr148ILL/R2DBGRZmXfvn0UFRWd1u+cFaVx4YUXkp+f7+0YIiLNSlJS0mn/jg5PiYiIaSoNERExTaUhIiKmnRXnNETEvOrqavbu3UtFRYW3o4iHtGnThqioKFq1anXGy1JpiLQwe/fuJSQkhM6dO2OxWLwdR5qYYRgcPnyYvXv3EhMTc8bL0+EpkRamoqKCc889V4XRQlgsFs4991y37VmqNERaIBVGy+LOv28dnhJp4Y6eqKKy2uG25QW28qNd29ZuW574FpWGSAtXWe1g4qqtblvec8m9oa3bFudWe/bsYcaMGWRnZ3s7SoNOnDjB2LFjmTNnDl26dKG6upr09HT27dtHVVUV48eP589//nOd33njjTdYsWIFISEhDB06lNtuu63J8qk0WiBX3yz1TVHEO7744gumT5/OTz/95Jz21ltvERYWxlNPPcWRI0e49dZb65RGaWkpzz33HPn5+YSGhjJmzBiuvvpqoqKimiSjSqMFcvXN0pe/KUrzl5+fzwcffEBFRQUHDx7kjjvuoKCggH//+99MmTKFAQMG8M477/Dyyy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UyIi4lkqDRERMU2lISIipqk0RETENJWGiIiYptIQOU2VlZVcf/313o4h4hUqDRERMc33xtwQ8UF2u53Jkydz7NgxOnXqBMDXX3/N7NmzAQgLC2Pu3LkEBwczc+ZMvvzySyIiIti3bx9Llixh0aJFHDlyhCNHjvDCCy/w4osv8tlnn+FwOBgzZgw33XRTvcsLCQnx2nsWqY9KQ8SEVatW0b17dyZNmsS2bdsoKioiIyODuXPn0rVrV1avXs2LL77IZZddxpEjR1izZg2lpaXccMMNzmVcddVVjBkzho8++oi9e/fy2muvUVlZyfDhw/m///u/epc3adIkL75rkVOpNERM+O677+jfvz8Af/zjHwkICGDPnj3MnDkT+PnBRp07dyYoKIjLL78cgPDw8DpDdcTExACwe/duduzYwejRowGoqalh37599S5PxNeoNERM6NKlC8XFxQwYMICdO3dSU1NDTEwM8+fPJzIyki1btnDw4EECAwN58803ATh69Cjfffedcxknh6COjY2lX79+zJo1C4fDweLFi4mOjq53eSK+RqUhYsKIESOYMmUKI0aMIDY2llatWjFjxgzS0tKoqanBYrEwZ84cOnfuTGFhIcnJyURERNCmTRtatWpVZ1nXX389mzdvZuTIkRw/fpwBAwYQHBxc7/JEfI0GLBRxoz179vDVV19x8803U1ZWxqBBg/jggw9o3bq1t6OJuIVKQ8SNjh8/zsMPP8zhw4epra1l1KhRDB061NuxRNxGpSEiIqbp5j4RETFNpSEiIqapNERExDSVhoiImKbSEBER0/4fxEufBdKXenQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "numNodes = 10000\n",
    "baseGraph    = networkx.barabasi_albert_graph(n=numNodes, m=9)\n",
    "# Baseline normal interactions:\n",
    "G_normal     = custom_exponential_graph(baseGraph, scale=100)\n",
    "plot_degree_distn(G_normal, max_degree=40)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Epidemic scenarios of interest often involve interaction networks that change in time. Multiple interaction networks can be defined and used at different times in the model simulation, as will be shown below.\n",
    "\n",
    "*Here we generate a graph representing interactions during corresponding to Social Distancing, where each individual drops some portion of their normal interactions with others. Again, we use the ```custom_exponential_graph()``` to generate this graph; for more information, see the README.*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAY0AAAEECAYAAADUGGjBAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy86wFpkAAAACXBIWXMAAAsTAAALEwEAmpwYAAAg9UlEQVR4nO3de1hUdeLH8ffhqnFRidwksMD0SbfcItK9EG49GrVZrjzmoKnZZSsrWigTlgSvaba7tCVpWbZtkAkq1T6bbRe2YtUNNxXd6OIula5iaYLKTIIwc35/+HM2Epwjwsygn9fz+Dxy5nDOZw46H8733AzTNE1EREQsCPB1ABER6T5UGiIiYplKQ0RELFNpiIiIZSoNERGxLMjXATrD8OHDOe+883wdQ0SkW9m9ezeVlZUn9T2nRWmcd955lJWV+TqGiEi3kpaWdtLfo+EpERGxTKUhIiKWqTRERMSy0+KYhoicuubmZnbt2kVjY6Ovo0gn69GjB7GxsQQHB5/yslQaIgLArl27iIiI4IILLsAwDF/HkU5imib79+9n165dxMfHn/LyNDwlIgA0NjZy9tlnqzBOM4ZhcPbZZ3faHqRKQ0TcVBinp878uWp4SkTadPDwEZqaXZ22vNDgAHr1DOm05YlvqDREpE1NzS7uX7ml05b3ZPpl0LPTFtepampqmD17NkVFRb6OckJ5eXn06tWL6dOnt5peW1tLbm4uTqcT0zSZO3cuCQkJXZJBw1Od6ODhI+w91Njun4OHj/g6ooh0UytXrmT79u1tvvbEE08wadIkioqKuOuuuygoKOiyHNrT6ESefjPz59+0RHytrKyMd999l8bGRvbt28eUKVMoLy/n3//+NzNmzGDkyJG88cYbvPDCCwQEBHD55Zczffp0vvrqK2bPnk1TUxP79u0jMzOTkSNHcsMNNzBs2DA+++wzDMNgyZIlREREuNe3d+9epk+fjmmanHPOOe7pGzdu5PHHHycwMJC4uDjmzp2L0+lkxowZ7N27l379+vHPf/6TdevWMXnyZKKiojh48CDLli1j9uzZ7NixA5fLRWZmJsOHD29zed899fXxxx9n8+bNrbbF8uXLCQn531De5s2b2bp1Kzabjc8///y4bZedne1+b06nk9DQ0E77uXyfSkNE/IbD4eD555/n9ddf54UXXqC0tJTKykpefPFFkpKSWLx4MWvWrKFnz5489NBDrF+/HsMwuPXWWxk+fDibN29m8eLFjBw5EofDwfXXX09eXh4PPvggFRUVXH/99e51Pf3004wePZrx48ezdu1aXn75ZUzTJC8vjxUrVnD22Wfzhz/8gVdeeYXDhw8TGxvLk08+SU1NDaNHj3YvZ/To0YwaNYoVK1bQp08fFixYQH19PZMmTeIvf/lLm8sbP368+/uzsrJOuE327t3LU089RWFhIW+88Uab80RFRQHw+eefs2jRIp566qlT+TGckEpDRPzG4MGDAYiIiGDAgAEYhkGvXr1oampi586d1NXVceeddwJHC2bnzp0kJSWxdOlSVq9ejWEYtLS0uJc3ZMgQAPr160dTU1OrdX355ZfuD+/ExERefvll6urq2Lt3L5mZmcDR05B/+tOfUl9fT0pKCgADBgxwf0gD7msftm/fzqZNm9i2bRsALS0t7S7vuzztafz1r3+lvr6eO++8k3379tHY2EhCQsJxNxv84IMPmDNnDo899liXHc8AlYaI+JETnRoaGxtLv379eP755wkODqasrIzBgwfzxBNPcNNNNzFixAjWrFnDK6+8Yml5AwYMYMuWLVx00UX861//AqBPnz6ce+657qGs8vJyzjrrLGpqatiyZQsjR45k586d1NfXH7eOhIQEzj33XO6++24aGxtZunRpu8v7Lk97GlOmTGHKlCnA0SG8zz//vM3CeOSRR3juuee6/DERKg0RaVNocMDR43CduLxTERUVxdSpU5k8eTJOp5PzzjuP6667jmuvvZbHHnuMZcuWce6557b6QD+RadOm8dBDD7F27VpiY2MBCAgI4OGHH+bOO+/ENE3CwsJ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PJLRowYAcCPfvQjgoKCqKmpYc6cOcDRBxtdcMEFhIWFcemllwIQFRXV6lYd8fHxAGzfvp3q6momT54MQEtLC7t3725zeSL+RqUhYsGAAQOoqqpi5MiRfPzxx7S0tBAfH8+iRYuIiYlh06ZN7Nu3j9DQUF577TUADh48yJdffulexrFbUCckJDB8+HDmzZuHy+ViyZIlxMXFtbk8EX+j0hCxYMKECcyYMYMJEyaQkJBAcHAws2fPJjs7m5aWFgzD4JFHHuGCCy6goqKC9PR0oqOj6dGjB8HBwa2WdfXVV7Nx40YmTpzIt99+y8iRIwkPD29zeSL+RjcsFOlENTU1fPrpp1x//fXU19czevRo3n33XUJCQnwdTaRTqDREOtG3337Lgw8+yP79+3E6nUyaNImxY8f6OpZIp1FpiIiIZbq4T0RELFNpiIiIZSoNERGxTKUhIiKWqTRERMSy/wOCMLhIMekfqwAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Social distancing interactions:\n",
    "G_distancing = custom_exponential_graph(baseGraph, scale=10)\n",
    "plot_degree_distn(G_distancing, max_degree=40)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "This SEIRS+ model features dynamics corresponding to testing individuals for the disease and moving individuals with detected infection into a state where their rate of recovery, mortality, etc may be different. In addition, given that this model considers individuals in an interaction network, a separate graph defining the interactions for individuals with detected cases can be specified.\n",
    "\n",
    "*Here we generate a graph representing the interactions that individuals have when they test positive for the disease. In this case, a significant portion of each individual's normal interaction edges are removed from the graph, as if the individual is quarantined upon detection of infection. Again, we use the ```custom_exponential_graph()``` to generate this graph; for more information, see the README.*\n",
    "\n",
    "For more information on how testing, contact tracing, and detected cases are handled in this model, see the README."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYwAAAEECAYAAAA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PJHsb48eNJT09n9uzZREdHk5CQgLe3NzExMSQlJWGz2ezvKK9trIiIuN8VK4zw8HCWLFkCQFRUFIsWLTpvzIgRIxgxYkSNbRcaWxdYLHDkVNkFb6/v40VDP31yoYjUTS7Zw7hWVFUbjFpScMHbX02+E/xcl0dExJlccg5DRETqPhWGiIiYosIQERFTVBgiImKKCkNERExRYYiIiCkqDBERMUWFISIipqgwRETEFBWGiIiYosIQERFTVBgiImKKCkNERExRYYiIiCkqDBERMUWFISIipqgwRETEFBWGiIiYosIQERFTVBgiImKKCkNERExRYYiIiCkqDBERMUWFISIipqgwRETEFBWGiIiYosIQERFTVBgiImKKCkNERExRYYiIiCn13B3gWmKxwJFTZRcdU9/Hi4Z+vi5KJCJingrDhaqqDUYtKbjomFeT7wQ/1+QREbkULi2MxMREAgICAAgPDycpKYkXXngBb29vYmNjGT58ODabjYyMDHbt2oWvry9ZWVk0btzYlTFFRKQWLiuM8vJyDMNg4cKF9m09evQgOzubiIgInnrqKXbs2EFRUREVFRXk5ORQUFDAzJkzmT9/vqtiiojIBbisMHbu3MnZs2cZNGgQVVVVjBgxgoqKCiIjIwGIjY1lw4YNFBcXc9999wFwxx13sH37dldFFBGRi3BZYTRo0IDBgwfTu3dv9u3bx5NPPklQUJD9dn9/f3766SdKS0vth60AvL29qaqqol69mlFzcnLIyckBoLq62jVPQkTkGuaywoiKiqJx48ZYLBaioqIIDAzkxIkT9tutVitBQUGUlZVhtVrt220223llAZCUlERSUhIA3R9NvOL5RUSudS57H8ayZcuYOXMmAL/88gtnz57luuuu48CBAxiGwbp164iJiaFdu3bk5eUBUFBQQIsWLVwVUURELsJlexi9evVi4sSJ9OnTB4vFwvTp0/Hy8mLMmDFUV1cTGxvL7bffzm233cb69etJTk7GMAymT5/uqogiInIRLisMX19f/vGPf5y3fcmSJTW+9/LyYtq0aa6KJSIiJunSICIiYooKQ0RETFFhiIiIKSoMERExRYUhIiKmqDBERMQUFYaIiJiiwhAREVP0AUoextGn8ukT+UTEX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IiCkqDBERMUWFIXKJysvLeeCBB9wdQ8TlVBgiImKK511HQ8QDWa1WxowZw6lTp4iMjARg165dZGVlAdCoUSOmT59OQEAAU6dOZfv27YSEhHDw4EHmz5/PnDlzOHHiBCdOnOD111/nzTff5LvvvsNms/HEE0/w0EMP1TpfYGCg256zyO+pMERM+PDDD2nRogWjRo1i69at5Ofnk56ezvTp02nWrBlLly7lzTff5LbbbuPEiRMsW7aMkpISOnfubJ/j7rvv5oknnuDrr7+mqKiIDz74gPLych577DHuvffeWucbNWqUG5+1SE0qDBET9u3bR6dOnQC4/fbbqVevHnv27GHq1KnAuQ8latKkCf7+/txxxx0ABAcH17j8RlRUFAC7d++msLCQlJQUAKqqqjh48GCt84l4EhWGiAlNmzaloKCAuLg4duzYQVVVFVFRUbz44ouEhYWxadMmiouLqV+/Pp988gkAJ0+eZN++ffY5fr2MdHR0NB06dCAzMxObzca8efOIiIiodT4RT6LCEDGhT58+jBs3jj59+hAdHY2Pjw8ZGRmMHz+eqqoqLBYLL7zwAk2aNCEvL4/k5GRCQkJo0KABPj4+NeZ64IEH2LhxI3379uXMmTPExcUREBBQ63winkQXHxRxoj179rBz504eeeQRjh8/TteuXVmzZg2+vr7ujiZy2VQYIk505swZnnvuOY4dO0Z1dTX9+/cnMTHR3bFEnEKFISIipuiNeyIiYooKQ0RETFFhiIiIKSoMERExRYUhIiKm/D9Hx8oRe9VOpAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Quarantine interactions:\n",
    "G_quarantine = custom_exponential_graph(baseGraph, scale=5)\n",
    "plot_degree_distn(G_quarantine, max_degree=40)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Initializing the model parameters\n",
    "All model parameter values, including the normal and quarantine interaction networks, are set in the call to the ```SEIRSNetworkModel``` constructor. The normal interaction network ```G``` and the basic SEIR parameters ```beta```, ```sigma```, and ```gamma``` are the only required arguments. All other arguments represent parameters for optional extended model dynamics; these optional parameters take default values that turn off their corresponding dynamics when not provided in the constructor. For clarity and ease of customization in this notebook, all available model parameters are listed below. \n",
    "\n",
    "For more information on parameter meanings, see the README.\n",
    "\n",
    "*The parameter values shown correspond to very rough approximations of parameter values for the COVID-19 epidemic.*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "SIGMA  = 1/5.2\n",
    "GAMMA  = 1/10\n",
    "MU_I   = 0.002\n",
    "\n",
    "R0     = 2.5\n",
    "BETA   = 1/(1/GAMMA) * R0\n",
    "BETA_Q = 0.5*BETA"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "/usr/local/lib/python3.8/site-packages/seirsplus/models.py:837: RuntimeWarning: divide by zero encountered in log\n",
      "  self.delta               = numpy.log(self.degree)/numpy.log(numpy.mean(self.degree))     if self.parameters['delta'] is None   else numpy.array(self.parameters['delta'])   if isinstance(self.parameters['delta'], (list, numpy.ndarray))   else numpy.full(fill_value=self.parameters['delta'], shape=(self.numNodes,1))\n",
      "/usr/local/lib/python3.8/site-packages/seirsplus/models.py:838: RuntimeWarning: divide by zero encountered in log\n",
      "  self.delta_Q             = numpy.log(self.degree_Q)/numpy.log(numpy.mean(self.degree_Q)) if self.parameters['delta_Q'] is None else numpy.array(self.parameters['delta_Q']) if isinstance(self.parameters['delta_Q'], (list, numpy.ndarray)) else numpy.full(fill_value=self.parameters['delta_Q'], shape=(self.numNodes,1))\n"
     ]
    }
   ],
   "source": [
    "model = SEIRSNetworkModel(G       = G_normal, \n",
    "                          beta    = BETA, \n",
    "                          sigma   = SIGMA, \n",
    "                          gamma   = GAMMA, \n",
    "                          mu_I    = MU_I,\n",
    "                          mu_0    = 0, \n",
    "                          nu      = 0, \n",
    "                          xi      = 0,\n",
    "                          p       = 0.2,\n",
    "                          G_Q       = G_quarantine, \n",
    "                          beta_Q  = 0.5*BETA, \n",
    "                          sigma_Q = SIGMA,\n",
    "                          gamma_Q = GAMMA, \n",
    "                          mu_Q    = MU_I,\n",
    "                          theta_E = 0, \n",
    "                          theta_I = 0, \n",
    "                          phi_E   = 0, \n",
    "                          phi_I   = 0, \n",
    "                          psi_E   = 1.0, \n",
    "                          psi_I   = 1.0,\n",
    "                          q       = 0.05,\n",
    "                          initI   = numNodes/100, \n",
    "                          initE   = 0, \n",
    "                          initQ_E = 0, \n",
    "                          initQ_I = 0, \n",
    "                          initR   = 0, \n",
    "                          initF   = 0)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Checkpoints\n",
    "Model parameters can be easily changed during a simulation run using checkpoints. A dictionary holds a list of checkpoint times (```checkpoints['t']```) and lists of new values to assign to various model parameters at each checkpoint time. Any model parameter listed in the model constrcutor can be updated in this way. Only model parameters that are included in the checkpoints dictionary have their values updated at the checkpoint times, all other parameters keep their pre-existing values.\n",
    "\n",
    "*The checkpoints shown here correspond to starting social distancing and testing at time ```t=20``` (the graph ```G``` is updated to ```G_distancing``` and locality parameter ```p``` is decreased to ```0.1```; testing params ```theta_E```, ```theta_I```, ```phi```, and ```phi_I``` are set to non-zero values) and then stopping social distancing at time ```t=100``` (```G``` and ```p``` changed back to their \"normal\" values; testing params remain non-zero).*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "checkpoints = {'t':       [20, 100], \n",
    "               'G':       [G_distancing, G_normal], \n",
    "               'p':       [0.1, 0.2], \n",
    "               'theta_E': [0.02, 0.02], \n",
    "               'theta_I': [0.02, 0.02], \n",
    "               'phi_E':   [0.2, 0.2], \n",
    "               'phi_I':   [0.2, 0.2]}"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Running the simulation"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'SEIRSNetworkModel' object has no attribute 'mu_Q'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-8-c46996d06e30>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mmodel\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mT\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m300\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mcheckpoints\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mcheckpoints\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;32m/usr/local/lib/python3.8/site-packages/seirsplus/models.py\u001b[0m in \u001b[0;36mrun\u001b[0;34m(self, T, checkpoints, print_interval, verbose)\u001b[0m\n\u001b[1;32m   1332\u001b[0m         \u001b[0;32mwhile\u001b[0m \u001b[0mrunning\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1333\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1334\u001b[0;31m             \u001b[0mrunning\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrun_iteration\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1335\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1336\u001b[0m             \u001b[0;31m#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.8/site-packages/seirsplus/models.py\u001b[0m in \u001b[0;36mrun_iteration\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m   1181\u001b[0m         \u001b[0;31m# Calculate propensities\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1182\u001b[0m         \u001b[0;31m#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1183\u001b[0;31m         \u001b[0mpropensities\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtransitionTypes\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcalc_propensities\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1184\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1185\u001b[0m         \u001b[0;32mif\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mpropensities\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msum\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m>\u001b[0m \u001b[0;36m0\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;32m/usr/local/lib/python3.8/site-packages/seirsplus/models.py\u001b[0m in \u001b[0;36mcalc_propensities\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m   1030\u001b[0m             \u001b[0mpropensities_QItoR\u001b[0m       \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgamma_Q\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mQ_I\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m&\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mnumpy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mgreater_equal\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrand_f\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1031\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1032\u001b[0;31m             \u001b[0mpropensities_QItoF\u001b[0m       \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mmu_Q\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mQ_I\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m&\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mnumpy\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mless\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mrand_f\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mf\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   1033\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   1034\u001b[0m             \u001b[0mpropensities_RtoS\u001b[0m        \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mxi\u001b[0m \u001b[0;34m*\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mX\u001b[0m\u001b[0;34m==\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mR\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
      "\u001b[0;31mAttributeError\u001b[0m: 'SEIRSNetworkModel' object has no attribute 'mu_Q'"
     ]
    }
   ],
   "source": [
    "model.run(T=300, checkpoints=checkpoints)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Visualizing the results\n",
    "The ```SEIRSNetworkModel``` class has a ```plot()``` convenience function for plotting simulation results on a matplotlib axis. This function generates a line plot of the frequency of each model state in the population by default, but there are many optional arguments that can be used to customize the plot.\n",
    "\n",
    "The ```SEIRSNetworkModel``` class also has convenience functions for generating a full figure out of model simulation results (optionaly arguments can be provided to customize the plots generated by these functions). \n",
    "- ```figure_basic()``` calls the ```plot()``` function with default parameters to generate a line plot of the frequency of each state in the population.\n",
    "- ```figure_infections()``` calls the ```plot()``` function with default parameters to generate a stacked area plot of the frequency of only the infection states ($E$, $I$, $Q_E$, $Q_I$) in the population.\n",
    "\n",
    "For more information on the built-in plotting functions, see the README."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.figure_infections(vlines=checkpoints['t'], ylim=0.15)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### Reference simulation visualizations\n",
    "\n",
    "We can also visualize the results of other simulation(s) as a reference for comparison of our main simulation.\n",
    "\n",
    "Here we simulate a model where no distancing or testing takes place, so that we can compare the effects of these interventions:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ref_model = SEIRSNetworkModel(G=G_normal, beta=BETA, sigma=SIGMA, gamma=GAMMA, mu_I=MU_I, p=P,\n",
    "                          Q=G_quarantine, beta_Q=BETA_Q, sigma_Q=SIGMA, gamma_Q=GAMMA, mu_Q=MU_I,\n",
    "                          theta_E=0, theta_I=0, phi_E=0, phi_I=0, psi_E=1.0, psi_I=1.0, q=0.05,\n",
    "                          initI=numNodes/100)\n",
    "ref_model.run(T=300)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now we can visualize our main simulation together with this reference simulation by passing the model object of the reference simulation to the appropriate figure function argument (note: a second reference simulation could also be visualized by passing it to the ```dasheQ_reference_results``` argument):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.figure_infections(vlines=checkpoints['t'], ylim=0.2, shadeQ_reference_results=ref_model)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "As further demonstration, we might also wish to compare the results of these network model simulations to a deterministic model simulation of the same SEIRS parameters (with no interventions in this case):"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "ref_model_determ = SEIRSModel(beta=0.147, sigma=1/5.2, gamma=1/12.39, mu_I=0.0004, initI=100, initN=10000) \n",
    "ref_model_determ.run(T=300)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "model.figure_infections(vlines=checkpoints['t'], ylim=0.2, \n",
    "                        shadeQ_reference_results=ref_model, shadeQ_reference_label='network: no interventions',\n",
    "                        dasheQ_reference_results=ref_model_determ, dasheQ_reference_label='deterministic: no interventions')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
